/**
 * 新页面，从主页进入ietm
 */

var container=new Vue({
	el:'#container',
	data:{
		title:'大系统',
		ietms:[],
		iets:[],
		ies:[],
	},
	methods:{
		click1:function(id,title){//一级
			
		},click2:function(id){//二级
			
		},click3:function(id){//三级
			
		}
	},created:function(){
		
	}
})
var mian_title=new Vue({
	el:"#title",
	data:{
		title:'大系统'
	}
});
//ietm主页面左侧菜单
var ietm_left=new Vue({
	el:"#ietm-left",
	data:{
		ietms:[],
		isActive:0,
		id:''
	},
	created:function(){
		var that=this;
		$.get('/ietm/data/1',function(data){
			that.ietms=data.pms;
		})
	},
	methods:{
		  clickPm:function(id,title){
		    	mian_title.title=title;
		    	this.id=id
		    }
	}
});



//点击左侧一级pm出长侧的二级pm
var pm_top=new Vue({  
		    el: '#pms',  
		    data: {
		    	ietms:[],
		    	isActive:0
		    },
		    created:function(){//2c90b22f66e7b4660166e7b5aab80069
		    	var that=this;
		    
				$.get('/ietm/data/2c90b22f66e7b4660166e7b5aab80069',function(data){
					that.ietms=data.pms;
				})
		    },
		    methods:{
		    	clickPm1:function(id){
		    		alert(ietm_left.id)
						//$(".interactive-rba li").removeClass("active");
						/*aa.addClass("active");
						var id=aa.attr('itemId');
						$.ajax({
							type:"POST",
							url:'/tree/getPmFirstLevel?id='+id,
							 success: function (data) {
								 if(data.items.length>0){
								 //pmSecList.$set(pmSecList.$data, "items", data.items);
								 pmThirdList.items =data.items;
								 }
								 else{
									 window.location.href='/tree/getChildrenList?id='+id;
								 }
							 }
						});*/
				    }
		    	
		    }
		   
		    
});



//2级
var pm_bottom=new Vue({  
	 	el: '#pm2s',  
	    data: {
	    	ietms:[],
	    	isActive:0
	    },
	    created:function(){//2c90b22f66e7b4660166e7b5aab80069
	    	var that=this;
			$.get('/ietm/data/2c90b22f66e7b4660166e7b5ab25006a',function(data){
				that.ietms=data.pms;
			})
	    },
	    methods:{
	    	clickPm2:function(id){
	    		 alert(id)
					//$(".interactive-rba li").removeClass("active");
					/*aa.addClass("active");
					var id=aa.attr('itemId');
					$.ajax({
						type:"POST",
						url:'/tree/getPmFirstLevel?id='+id,
						 success: function (data) {
							 if(data.items.length>0){
							 //pmSecList.$set(pmSecList.$data, "items", data.items);
							 pmThirdList.items =data.items;
							 }
							 else{
								 window.location.href='/tree/getChildrenList?id='+id;
							 }
						 }
					});*/
			    }
	    	
	    }
});

//三级pm
var pmThirdList=new Vue({  
    el: '#pmThirdList',  
    data: { "items": []}  
});
$(function(){
	$(".nav-bottom-show").click(function(event){
		event.stopPropagation();//阻止冒泡事件
		$(this).hide();
		$(".nav-bottom-content").show(500);
	});
	$(document).click(function(){
        $(".nav-bottom-content").hide(500);
        $(".nav-bottom-show").show();
    });
	var indexPmId=$('#indexPmId').val();
	if($(".interactive-la li[id='"+indexPmId+"']").length>0){
		$(".interactive-la li[id='"+indexPmId+"']").click();
	}
	else{
	$(".interactive-la li:first").click();}
});



/**
 * 点击三级PM
 */
function clickThirdPm(id){
	window.location.href='/tree/getChildrenList?id='+id;
	//loadPage('/tree/getChildrenList?id='+id,'N');
}

